package com.ticket.sass.admin.dto.output.config;

import com.ticket.sass.admin.model.KeyInfoModel;
import com.ticket.sass.common.entity.tenant.WxaConfigEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Objects;

/**
 * @author ywb
 * @date 2024-03-24 17:28
 */
@Data
@ApiModel
public class WxaConfigOutput {
    @ApiModelProperty(value = "首页分享封面")
    private KeyInfoModel homeShareCover;
    
    @ApiModelProperty(value = "首页分享文案")
    private String homeShareContent;
    
    @ApiModelProperty(value = "隐私协议名称")
    private String privacyPolicyTitle;
    
    @ApiModelProperty(value = "隐私协议内容")
    private String privacyPolicyContent;
    
    public WxaConfigOutput() {
    }
    
    public WxaConfigOutput(WxaConfigEntity entity) {
        if (Objects.isNull(entity)){
            return;
        }
        
        this.homeShareCover = new KeyInfoModel(entity.getHomeShareCover());
        this.homeShareContent = entity.getHomeShareContent();
        this.privacyPolicyTitle = entity.getPrivacyPolicyTitle();
        this.privacyPolicyContent = entity.getPrivacyPolicyContent();
    }
}
